﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MvcEngine.Core.Validation
{
    /// <summary>
    /// Base class for all object validators. Each implementation of a <see cref="ObjectValidatorAttribute"/> has the Message property that contains the message that should be displayed if the validation of that object is failed.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
    public abstract class ObjectValidatorAttribute : ValidatorBase
    {
        /// <summary>
        /// Gets or sets the message.
        /// </summary>
        /// <value>The message.</value>
        public string Message { get; set; }

        /// <summary>
        /// Gets or sets the property name to validate.
        /// </summary>
        /// <value>The property name to validate.</value>
        public string PropertyNameToValidate { get; set; }

        /// <summary>
        /// Determines whether the specified object is valid.
        /// </summary>
        /// <param name="obj">The object to validate.</param>
        /// <returns>
        /// 	<see langword="true"/> if the specified object is valid; otherwise, <see langword="false"/>.
        /// </returns>
        //public abstract bool IsValid(object obj);
    }
}
